// store/index.js
import {createStore} from 'vuex'
import router from "../routes/index";
import { reactive } from 'vue'
export default createStore({
    state: {
        user:reactive(JSON.parse(localStorage.getItem('user') )|| {user_id:"",userName:'请登录'})
        //userid:localStorage.getItem('user').id||'',
        
    },
    mutations: {
        
    },
    actions: {
        goproductsellpage(context,id){

            router.push({
                name:'productsellpage',
                query:{
                    id:id
                }
            })
        }
    },
})
